package cqrtplm.service.impl;


import cqrtplm.entity.DspfMbomAppointdetailDO;
import cqrtplm.mapper.DspfMbomAppointdetailMapper;
import cqrtplm.service.DspfMbomAppointdetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * (DSPF_MBOM_APPOINTDETAIL)表服务实现类
 *
 * @author admin
 * @since 2025-07-17 18:43:44
 */
@Service("dspfMbomAppointdetailService")
public class DspfMbomAppointdetailServiceImpl implements DspfMbomAppointdetailService {
    @Resource
    private DspfMbomAppointdetailMapper dspfMbomAppointdetailMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param detailid 主键
     * @return 实例对象
     */
    @Override
    public DspfMbomAppointdetailDO queryById(Object detailid) {
        return this.dspfMbomAppointdetailMapper.selectByPrimaryKey(detailid);
    }

    /**
     * 新增数据
     *
     * @param DspfMbomAppointdetailDO 实例对象
     * @return 实例对象
     */
    @Override
    public DspfMbomAppointdetailDO insert(DspfMbomAppointdetailDO DspfMbomAppointdetailDO) {
        this.dspfMbomAppointdetailMapper.insert(DspfMbomAppointdetailDO);
        return DspfMbomAppointdetailDO;
    }

    /**
     * 修改数据
     *
     * @param DspfMbomAppointdetailDO 实例对象
     * @return 实例对象
     */
    @Override
    public DspfMbomAppointdetailDO update(DspfMbomAppointdetailDO DspfMbomAppointdetailDO) {
        this.dspfMbomAppointdetailMapper.update(DspfMbomAppointdetailDO);
        return this.queryById(DspfMbomAppointdetailDO.getDetailid());
    }

    /**
     * 通过主键删除数据
     *
     * @param detailid 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Object detailid) {
        return this.dspfMbomAppointdetailMapper.deleteByPrimaryKey(detailid) > 0;
    }
}

